package cn.hzxs.zjn.studentmanagement.sevice.serviceImpl;

import cn.hzxs.zjn.studentmanagement.dao.UserMapper;
import cn.hzxs.zjn.studentmanagement.domain.User;
import cn.hzxs.zjn.studentmanagement.sevice.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @Author: Zjn ; Bring it on !!!
 * @Date: 2021/3/23 0023 15:11
 * Note:
 */
@Service("UserService")
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;

    /*----------------------登录功能---------------------*/
    @Override
    public Map findUserIdByPhone(String phone) {
        return userMapper.findUserIdByPhone(phone);
    }

    @Override
    public Map findUserIdByUserName(String username) {
        return userMapper.findUserIdByUserName(username);
    }

    @Override
    public Integer ifExistUsername(String username) {
        return userMapper.ifExistUsername(username);
    }

    @Override
    public Integer ifExistPhone(String phone) {
        return userMapper.ifExistPhone(phone);
    }

    @Override
    public String findPasswordByUsername(String username) {
        return userMapper.findPasswordByUsername(username);
    }

    @Override
    public String findPasswordByPhone(String phone) {
        return userMapper.findPasswordByPhone(phone);
    }

    /*-----------------------注册功能----------------------------*/
    @Override
    public void userReg(User user) {
        userMapper.userReg(user);
    }

    /*-----------------------查询---------------------------------*/
    @Override
    public Map<String,String> findUsernameIconByAuthorId(Integer author_id) {
        return userMapper.findUsernameIconByAuthorId(author_id);
    }

    @Override
    public List<Map> userGet() {
        return userMapper.userGet();
    }

    @Override
    public Map personal(Integer userId) {
        return userMapper.personal(userId);
    }

    @Override
    public List<Map> teacher_planGet() {
        return userMapper.teacher_planGet();
    }
}
